package ldh.im.fxbase.data.dto;

import ldh.im.fxbase.data.pojo.ImSession;

/**
 * 搜索结果
 */
public class SearchResult {

    private String userId;          // 用户ID
    private String userName;
    private String groupCode;
    private String groupName;
    private Long messageTotal;
    private Long sessionId;

    private transient ImSession imSession;

    public boolean isUser() {
        return userId != null && groupCode == null;
    }

    public boolean isGroupUser() {
        return userId != null && groupCode != null;
    }

    public boolean isGroup() {
        return userId == null && groupCode != null;
    }

    public boolean isMessage() {
        return userId == null && groupCode == null && sessionId != null;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Long getMessageTotal() {
        return messageTotal;
    }

    public void setMessageTotal(Long messageTotal) {
        this.messageTotal = messageTotal;
    }

    public Long getSessionId() {
        return sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public ImSession getImSession() {
        return imSession;
    }

    public void setImSession(ImSession imSession) {
        this.imSession = imSession;
    }
}
